package com.geping.etl.common.controller;

import com.geping.etl.utils.EnvUitl;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;

/***
 *  跑批程序控制器
 * @author liang.xu
 * @date 2021.7.23
 */
@RestController
public class Sys_DataSourceController {

    private String getServerUrl() {
        return EnvUitl.props.getProperty("commomServer.host") + "/" + EnvUitl.props.getProperty("commomServer.serverName");
    }

    @RequestMapping(value = "/sys_dataSourceView", method = RequestMethod.GET)
    public ModelAndView sysDataSourceView(HttpServletRequest request) {
        ModelAndView model = new ModelAndView();
        model.setViewName("common/sys_dataSource");
        model.addObject("serverUrl", this.getServerUrl());
        return model;
    }
}